import Vue from 'vue'
import VueRouter from 'vue-router'

const Login = () => import('../views/Login/Login')//登录页面
const Home = () => import('../views/Home/Home')//后台首页
const System = () => import('../views/System/System')//系统设置

const Message = () => import('../views/Allmessage/message/message')//留言板管理
const MessageEdit = () => import('../views/Allmessage/message/messageItem/messageEdit')//留言板管理编辑

const imgDown = () => import('../views/Allmessage/imgDown/imgDown') //你的足迹管理
const imgDownEdit = () => import('../views/Allmessage/imgDown/imgDownEdit/imgDownEdit')//足迹的编辑页面

const chat = () => import('../views/Allmessage/Mychat/chat') //碎言碎语管理
const chatAdd = () => import('../views/Allmessage/Mychat/chatOther/chatAdd')//添加碎言碎语
const chatUpdate = () => import('../views/Allmessage/Mychat/chatOther/updateChat')//修改碎言碎语

Vue.use(VueRouter)

  const routes = [
    {
      path:'/',
      redirect:'/Admin/login'
    },
    {
      path:'/Admin/login',
      component:Login
    },
    {
      path:'/Admin/home',
      component:Home
    },
    {
      //默认为  基础设置
      path:'/Admin/system',
      component:System
    },
    {
      path:'/Admin/message',
      component:Message,
      children:[
        {
          path:'/message/Edit',
          name:'messageEdit',
          component:MessageEdit
        }
      ]
    },
    {
      path:'/Admin/imgDown',
      component:imgDown,
      children:[
        {
          path:'/imgDown/Edit',
          name:'imgDownEdit',
          component:imgDownEdit
        }
      ]
    },
    {
      path:'/Admin/chat',
      component:chat,
      children:[
        {
          //添加chat
          path:'/chat/chatAdd',
          name:'chatAdd',
          component:chatAdd
        },
        {
          //修改chat
          path:'/chat/update',
          name:'chatUpdate',
          component:chatUpdate
        }
      ]
    }
  ]


const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
